#ifndef _S_COMMON_MESSAGE_H_
#define _S_COMMON_MESSAGE_H_

#include "s_common.h"

typedef struct _s_message_t
{
	unsigned char *message;
	unsigned short message_len;
	void (*callBack)(const unsigned char *data, unsigned short len);
	struct _s_message_t *next;
}s_message_t;

#define STRLEN(x)		((sizeof(x) / sizeof(unsigned char)) - 1)
#define ARRAYLEN(x)		(sizeof(x) / sizeof(unsigned char))

extern void s_common_message_init(void);
extern s_common_state s_common_message_add(const unsigned char *cmd, unsigned short len, void *callBack);
extern s_common_state s_common_message_head(const unsigned char *cmd, unsigned short len);

#endif
